package com.pet.platform.mapper;

import com.pet.platform.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Optional;

@Mapper
public interface ProductMapper {
    Optional<Product> findById(Long id);
    
    List<Product> findList(Map<String, Object> params);
    
    Long count(Map<String, Object> params);
    
    void insert(Product product);
    
    void update(Product product);
    
    void delete(@Param("id") Long id);
    
    void updateStock(@Param("product") Product product);
    
    void updateSales(@Param("id") Long id, @Param("increment") Integer increment);
} 